package com.spzx.channel.service.impl;

import com.spzx.channel.service.BrandService;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.exception.ServiceException;
import com.spzx.product.api.RemoteBrandService;
import com.spzx.product.api.RemoteProductService;
import com.spzx.product.domain.Brand;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;



@Service
public class BrandServiceImpl implements BrandService {

    @Resource
    private RemoteBrandService remoteBrandService;


    @Override
    public List<Brand> getBrandAll() {
        R<List<Brand>> brandAllList = remoteBrandService.getBrandAllList();
        if (R.FAIL==brandAllList.getCode()){
            //说明失败了
            throw  new ServiceException(brandAllList.getMsg());
        }


        return brandAllList.getData();
    }
}
